package com.example.springboot_experiment1;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

import java.util.Arrays;
@Slf4j
@SpringBootApplication
public class SpringbootExperiment1Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootExperiment1Application.class, args);
    }

//    @Bean
//    public CommandLineRunner commandLineRunner(ApplicationContext context) {
//        return args -> {
//            log.info("\n SpringBoot注册的所有bean如下：");
//            final String[] beanDefinitionNames = context.getBeanDefinitionNames();
//            Arrays.stream(beanDefinitionNames)
//                    .sorted()
//                    .forEach(System.out::println);
//        };
//    }
}
